package com.emip.service.impl;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.emip.bean.DayStoreBean;
import com.emip.dao.DayStoreDAO;
import com.emip.service.DayStoreService;

@Service("dayStoreService")
public class DayStoreServiceImpl implements DayStoreService {

	@Autowired
	DayStoreDAO dayStoreDAO;
	
	public List<DayStoreBean> getByTimespan(String startDate, String endDate,
			String[] itemIds, String siteId) {
		return dayStoreDAO.getByTimespan(startDate, endDate, itemIds, siteId);
	}
	
	public List<DayStoreBean> getByTimespan(String startDate, String endDate,
			String[] itemIds, String siteId, int page, int size) {
		return dayStoreDAO.getByTimespan(startDate, endDate, itemIds, siteId, page, size);
	}

	public DayStoreBean merge(DayStoreBean store) {
		return dayStoreDAO.merge(store);
	}

	public Date getLastDate(String itemId, String siteId) {
		return dayStoreDAO.getLastDate(itemId, siteId);
	}

	public long getCount(String startDate, String endDate, String[] itemIds,
			String siteId) {
		return dayStoreDAO.getCount(startDate, endDate, itemIds, siteId);
	}

	public Object[] getStatistics(String startDate, String endDate,
			String itemIds, String siteId) {
		return dayStoreDAO.getStatistics(startDate, endDate, itemIds, siteId);
	}

	public DayStoreBean findByDay(String date, String siteId, String itemId) {
		return dayStoreDAO.findByDay(date, siteId, itemId);
	}

}
